## ── Attaching packages ──────────────────── tidyverse 1.2.1 ──
## ✔ ggplot2 3.2.0 ✔ purrr 0.3.2
## ✔ tibble 2.1.3 ✔ dplyr 0.8.1
## ✔ tidyr 0.8.3 ✔ stringr 1.4.0
## ✔ readr 1.3.1 ✔ forcats 0.4.0
## ── Conflicts ─────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## Loading required package: viridisLite
phy <- readRDS("../../data/RDS/worle_with_meta.RDS")
by_matrix_tsne <- tsne_phyloseq_ggplot(phy, treatment = c('matrix'), perplexity = 10, circle = TRUE, colors = 'default') +
scale_fill_viridis(discrete = T, option = "viridis") + ggplot2::theme_bw() +
guides(fill=guide_legend(title="Matrix"))
by_matrix_tsne
We can see that each matrix clusters seperately from each other, with the water and manure being very similar. This is to be expected as the water is runoff from a rainfall simulation performed immediately after the manure was applied.
water <- subset_samples(phy, matrix == "water") %>%
filter_taxa(function(x) sum(x) > 15, T)
water_tsne <- tsne_phyloseq_ggplot(water, treatment = c('treatment'), perplexity = 10, circle = T, colors = 'default') +
scale_fill_viridis(discrete = T, option = "viridis") + ggplot2::theme_bw() +
guides(fill = guide_legend(title = "Treatment"))
water_tsne
soil_depth_1 <- subset_samples(phy, matrix == "soil" & depth == "d1") %>%
filter_taxa(function(x) sum(x) > 15, T)
tsne_soil_depth_1 <- tsne_phyloseq_ggplot(soil_depth_1, treatment = c('treatment'), perplexity = 10, circle = TRUE, colors = 'default') +
scale_fill_viridis(discrete = T, option = "viridis") + ggplot2::theme_bw() +
guides(fill=guide_legend(title="Treatment"))
tsne_soil_depth_1
only_prairie_samples <- subset_samples(soil_depth_1, in_plot_location %in% c("s6", "s7", "s8", "s9")) %>%
filter_taxa(function(x) sum(x) > 15, T)
only_prairie_samples_tsne <- tsne_phyloseq_ggplot(only_prairie_samples, treatment = c('treatment'), perplexity = 10, circle = TRUE, colors = 'default') +
scale_fill_viridis(discrete = T, option = "viridis") + ggplot2::theme_bw() +
guides(fill=guide_legend(title="Treatment"))
only_prairie_samples_tsne
only_crop_samples <- subset_samples(soil_depth_1, in_plot_location %in% c("s1", "s2", "s3", "s4", "s5")) %>%
filter_taxa(function(x) sum(x) > 15, T)
only_crop_samples_tsne <- tsne_phyloseq_ggplot(only_crop_samples, treatment = c('treatment'), perplexity = 10, circle = TRUE, colors = 'default') +
scale_fill_viridis(discrete = T, option = "viridis") + ggplot2::theme_bw() +
guides(fill=guide_legend(title="Treatment"))
only_crop_samples_tsne
soil_depth_2 <- subset_samples(phy, matrix == "soil" & depth == "d2") %>%
filter_taxa(function(x) sum(x) > 15, T)
tsne_soil_depth_2 <- tsne_phyloseq_ggplot(soil_depth_2, treatment = c('treatment'), perplexity = 10, circle = TRUE, colors = 'default') +
scale_fill_viridis(discrete = T, option = "viridis") + ggplot2::theme_bw() +
guides(fill=guide_legend(title="Treatment"))
tsne_soil_depth_2
only_prairie_samples <- subset_samples(soil_depth_2, in_plot_location %in% c("s6", "s7", "s8", "s9")) %>%
filter_taxa(function(x) sum(x) > 15, T)
only_prairie_samples_tsne <- tsne_phyloseq_ggplot(only_prairie_samples, treatment = c('treatment'), perplexity = 10, circle = TRUE, colors = 'default') +
scale_fill_viridis(discrete = T, option = "viridis") + ggplot2::theme_bw() +
guides(fill=guide_legend(title="Treatment"))
only_prairie_samples_tsne
only_prairie_samples_tsne.f <- tsne_phyloseq_ggplot(only_prairie_samples, treatment = c('treatment'), perplexity = 10, circle = TRUE, colors = 'default') +
scale_fill_viridis(discrete = T, option = "viridis") + ggplot2::theme_bw() +
guides(fill=guide_legend(title="Treatment")) +
facet_wrap(~day)
only_prairie_samples_tsne.f
only_crop_samples <- subset_samples(soil_depth_2, in_plot_location %in% c("s1", "s2", "s3", "s4", "s5")) %>%
filter_taxa(function(x) sum(x) > 15, T)
only_crop_samples_tsne <- tsne_phyloseq_ggplot(only_crop_samples, treatment = c('treatment'), perplexity = 10, circle = TRUE, colors = 'default') +
scale_fill_viridis(discrete = T, option = "viridis") + ggplot2::theme_bw() +
guides(fill=guide_legend(title="Treatment"))
## Scale for 'fill' is already present. Adding another scale for 'fill',
## which will replace the existing scale.
only_crop_samples_tsne